/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jay9downloader;

import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

/**
 *
 * @author Jonas
 */
public class videoTablePlayButton extends JButton implements TableCellRenderer, ActionListener {

    public videoTablePlayButton() {
        super();
        this.setFocusable(true);
        this.addActionListener(this);
    }

    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        this.setText("Play");
        if(value == null) {
            this.setEnabled(false);
        } else {
            this.setEnabled(true);
        }
        return this;
    }

    public void actionPerformed(ActionEvent e) {
        System.out.println("clicked");
    }

}
